package com.school.device.util;

import java.net.InetAddress;

public class PingUtil {	
	public static Boolean ping(String ip){
		try {
			InetAddress address = InetAddress.getByName(ip);
			return address.isReachable(1000); // 超时时间设置为1秒
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
		
	public static void main(String[] args) {

	}
}
